package com.tuanzi.loan.web.lazy.statistics;

import com.tuanzi.loan.business.service.statistics.WechatAccountService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.statistics.WechatAccountRequest;
import com.tuanzi.loan.vo.response.statistics.WechatAccountResponse;
import org.springframework.data.domain.Page;

/**
 * @Auther: hequnayu
 * @Date: 2019/5/14 14:17
 * @Description:
 */
public class WechatAccountLazyDataModel extends BaseLazyDataModel<WechatAccountRequest, WechatAccountResponse> {

    // 获取service
    private WechatAccountService wechatAccountService = SpringContextHolder.getBean(WechatAccountService.class);

    public WechatAccountLazyDataModel(WechatAccountRequest wechatAccountRequest) {
        super(wechatAccountRequest);
    }

    @Override
    protected Page<WechatAccountResponse> doLoad(PageSearcher<WechatAccountRequest> pageSearcher) {
        return wechatAccountService.list(pageSearcher);
    }
}
